#include <iostream>
#include <cryptopp/sha.h>

#define CRYPTOPP_ENABLE_NAMESPACE_WEAK 1
#include <cryptopp/md5.h>
#include <cryptopp/hex.h>
#include <cryptopp/filters.h>
#include <cryptopp/files.h>


std::string CalMD5ByFile(char *pszFileName)
{

	using namespace CryptoPP;
	std::string value;
	CryptoPP::Weak::MD5 md5;
	FileSource(pszFileName, true, new HashFilter(md5, new HexEncoder(new StringSink(value))));
	return value;
}
int main(int argc, char *argv[])
{
	std::cout << "HashCode" << std::endl;
	if(argc == 2){
		std::cout << CalMD5ByFile(argv[1]) << std::endl;
	}
	return 0;
}
